import request from "@/utils/request";
import type {WfModel, WfModelQuery, WfModelVo} from "./types";
import type {AxiosPromise} from "axios";

// 查询模型列表
export function listWfModel(query: WfModelQuery): AxiosPromise<WfModelVo[]> {
  return request({
    url: "/flowable/wfModel/list",
    method: "get",
    params: query
  });
}

// 新增模型
export function addWfModel(data: WfModel) {
  return request({
    url: "/flowable/wfModel",
    method: "post",
    data: data
  });
}

// 修改模型
export function updateWfModel(data: WfModel) {
  return request({
    url: "/flowable/wfModel",
    method: "put",
    data: data
  });
}

// 删除模型
export function delWfModel(id: string) {
  return request({
    url: "/flowable/wfModel/" + id,
    method: "delete"
  });
}
